package com.itic.appbase.framework.type;

public enum UserType {
	user("001","普通用户"),ydz("002","云店主");
	
	private String type;
	
	private String name;
	UserType (String type,String name){
		this.type = type;
		this.name = name;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static UserType getUserType(String type) {
		UserType userType = null;
		switch (type) {
		case "001":
			userType = userType.user;
			break;
		case "002":
			userType = userType.ydz;
			break;
		default:
			break;
		}
		return userType;
	}
	
	public static boolean isYDZ(String type) {
		UserType userType = UserType.getUserType(type);
		if(userType == null)
			return false;
		if( userType.getType().equals("002") &&userType.getType().equals(type))
			return true;
		else 
			return false;
	}
}	
